<template>
    <el-form-item :label="label">
        <el-select v-model="value" placeholder="" v-bind="sonAttrs" size="small" filterable>
            <el-option size="small"
                v-for="item in sonAttrs.options!.value||sonAttrs.options"
                :key="item.value"
                :label="item.label"
                :value="item.value"
            />
            </el-select>
    </el-form-item>
</template>
<script setup lang="ts">
import {computed,useAttrs ,Ref} from 'vue'
const value = defineModel()
const attrs = useAttrs()
const {label} = defineProps<{
    label:string
}>()
type options = {value:string,label:string}[];
type attrsType = {[key:string]:any,options?:Ref<options>|options};
const sonAttrs = computed<attrsType>(()=>{
    let attr = {...attrs}
    if(!('options' in attr))attr['options'] = []
    return attr
})
</script>
<style scoped>
.el-select-dropdown__item{
    font-size: 12px;
}
</style>